Archived
1
0

* raised version to 1.12

* made compatible with SMF 1.1rc3
* moved basic strings from Modifications.<lang>.php to sbox.<lang>.php so that there now is language fallback to English (and 1 file less to change)
+ check for lock before removing History file
This commit is contained in:
mbirth 2006-08-23 06:36:45 +00:00
parent d011b2b6cd
commit 5cdb0f1d7b
8 changed files with 202 additions and 142 deletions

View File

@ -1,27 +1,26 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info"> <!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/"> <package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<name>SMF Shoutbox LanguagePack German</name> <name>SMF Shoutbox LanguagePack German</name>
<id>Deep:SMF_Shoutbox:LangPack_German</id> <id>Deep:SMF_Shoutbox:LangPack_German</id>
<type>modification</type> <type>modification</type>
<version>1.11</version> <version>1.12</version>
<install for="1.1 RC2"> <install>
<readme type="inline"> <require-file name="sbox.german.php" destination="$languagedir" />
<![CDATA[ <readme type="inline">
This adds the german language pack for SMF shoutbox to your SMF forum. <![CDATA[
This adds the german language pack for SMF shoutbox to your SMF forum.
Originally written By Deep (diem4@gmx.net), inspired by Matthew Wolf (a.k.a Grudge) Originally written By Deep (diem4@gmx.net), inspired by Matthew Wolf (a.k.a Grudge)
Heavily improved by Markus Birth (mbirth@webwriters.de) Heavily improved by Markus Birth (mbirth@webwriters.de)
Copyright 2006 - Neither this package or any of it's contents may be distributed without authorization. Copyright 2006 - Neither this package or any of it's contents may be distributed without authorization.
]]> ]]>
</readme> </readme>
<modification type="file" format="boardmod">sbox_11rc2_german.mod</modification> <modification type="file" format="boardmod">sbox_11rc3_german.mod</modification>
</install> </install>
<uninstall for="1.1 RC2"> <uninstall>
<readme type="inline">Uninstall will remove all the changes made by the SMF shoutbox german language pack. You must do this before upgrading!</readme> <remove-file name="$languagedir/sbox.german.php" />
<modification type="file" format="boardmod" reverse="true">sbox_11rc2_german.mod</modification> <readme type="inline">Uninstall will remove all the changes made by the SMF shoutbox german language pack. You must do this before upgrading!</readme>
</uninstall> <modification type="file" format="boardmod" reverse="true">sbox_11rc3_german.mod</modification>
<install> </uninstall>
<readme type="inline">Sorry, but the SMF Shoutbox Mod doesn't support your SMF version!</readme>
</install>
</package-info> </package-info>

View File

@ -0,0 +1,31 @@
<?php
//SMF Shoutbox
$txt['sbox_ModTitle'] = 'SMF Shoutbox';
$txt['sbox_Visible'] = 'Shoutbox ist sichtbar';
$txt['sbox_GuestAllowed'] = 'G&auml;ste d&uuml;rfen shouten';
$txt['sbox_GuestVisible'] = 'Shoutbox ist f&uuml;r G&auml;ste sichtbar';
$txt['sbox_MaxLines'] = 'Anzahl der angezeigten Zeilen';
$txt['sbox_Height'] = 'Shoutbox-H&ouml;he (px)';
$txt['sbox_SmiliesVisible'] = 'Smiley-Zeile ist sichtbar';
$txt['sbox_UserLinksVisible'] = 'Shouter-Namen mit Profil verlinken';
$txt['sbox_KillShout'] = 'Diesen Shout löschen?';
$txt['sbox_TextSize1'] = '1. Schriftgr&ouml;&szlig;e';
$txt['sbox_TextColor1'] = '1. Schriftfarbe';
$txt['sbox_TextSize2'] = '2. Schriftgr&ouml;&szlig;e';
$txt['sbox_TextColor2'] = '2. Schriftfarbe';
$txt['sbox_RefreshTime'] = 'Aktualisierungsintervall';
$txt['sbox_BlockRefresh'] = 'Aktualisierung nach Inaktivit&auml;t stoppen (' . $modSettings['lastActive'] . ' min)';
$txt['sbox_BackgroundColor'] = 'Hintergrundfarbe';
$txt['sbox_FontFamily1'] = '1. Schriftart';
$txt['sbox_FontFamily2'] = '2. Schriftart';
$txt['sbox_DoHistory'] = 'Shout-Verlauf anlegen';
$txt['sbox_AllowBBC'] = 'BBCode erlauben';
$txt['sbox_Refresh'] = 'Neu laden';
$txt['sbox_RefreshBlocked'] = 'Automatische Aktualisierung wegen Inaktivit&auml;t ausgeschaltet';
$txt['sbox_History'] = 'Verlauf';
$txt['sbox_HistoryClear'] = 'Verlauf l&ouml;schen';
$txt['sbox_HistoryNotFound'] = 'Kein Verlauf gefunden.';
$txt['sbox_EnableSounds'] = 'Kl&auml;nge abspielen';
?>

View File

@ -3,7 +3,7 @@ SMF Shoutbox , German Language Pack
</id> </id>
<version> <version>
1.11 1.12
</version> </version>
<mod info> <mod info>

View File

@ -4,14 +4,15 @@
<name>SMF Shoutbox</name> <name>SMF Shoutbox</name>
<id>Deep:SMF_Shoutbox</id> <id>Deep:SMF_Shoutbox</id>
<type>modification</type> <type>modification</type>
<version>1.11</version> <version>1.12</version>
<install for="1.1 RC2"> <install for="1.1 RC2">
<require-file name="sbox.php" destination="$sourcedir" /> <require-file name="sbox.php" destination="$sourcedir" />
<require-file name="sboxDB.php" destination="$sourcedir" /> <require-file name="sboxDB.php" destination="$sourcedir" />
<require-file name="sbox.english.php" destination="$languagedir" />
<require-file name="sbox.template.php" destination="$themedir" /> <require-file name="sbox.template.php" destination="$themedir" />
<require-file name="sbox_refresh.gif" destination="$themedir/images" /> <require-file name="sbox_refresh.gif" destination="$themedir/images" />
<require-file name="chat-inbound_GSM.wav" destination="$boarddir" /> <require-file name="chat-inbound_GSM.wav" destination="$boarddir" />
<require-file name="sbox_v1.11_german.zip" destination="$boarddir/Packages" /> <require-file name="sbox_v1.12_german.zip" destination="$boarddir/Packages" />
<code type="file">sbox_setup.php</code> <code type="file">sbox_setup.php</code>
<readme type="inline"> <readme type="inline">
<![CDATA[ <![CDATA[
@ -22,18 +23,52 @@
Copyright 2006 - Neither this package or any of it's contents may be distributed without authorisation. Copyright 2006 - Neither this package or any of it's contents may be distributed without authorisation.
]]> ]]>
</readme> </readme>
<modification type="file" format="boardmod">sbox_11rc2.mod</modification> <modification type="file" format="boardmod">sbox_11rc3.mod</modification>
</install>
<install for="1.1 RC3">
<require-file name="sbox.php" destination="$sourcedir" />
<require-file name="sboxDB.php" destination="$sourcedir" />
<require-file name="sbox.english.php" destination="$languagedir" />
<require-file name="sbox.template.php" destination="$themedir" />
<require-file name="sbox_refresh.gif" destination="$themedir/images" />
<require-file name="chat-inbound_GSM.wav" destination="$boarddir" />
<require-file name="sbox_v1.12_german.zip" destination="$boarddir/Packages" />
<code type="file">sbox_setup.php</code>
<readme type="inline">
<![CDATA[
This allows you to put a shoutbox on your SMF forum above the board index of the default theme.
Originally written By Deep (diem4@gmx.net), inspired by Matthew Wolf (a.k.a Grudge)
Heavily improved by Markus Birth (mbirth@webwriters.de)
Copyright 2006 - Neither this package or any of it's contents may be distributed without authorisation.
]]>
</readme>
<modification type="file" format="boardmod">sbox_11rc3.mod</modification>
</install> </install>
<uninstall for="1.1 RC2"> <uninstall for="1.1 RC2">
<readme type="inline">Uninstall will remove all the changes made by the shoutbox. You must do this before upgrading!</readme> <readme type="inline">Uninstall will remove all the changes made by the shoutbox. You must do this before upgrading!</readme>
<modification type="file" format="boardmod" reverse="true">sbox_11rc2.mod</modification> <modification type="file" format="boardmod" reverse="true">sbox_11rc3.mod</modification>
<remove-file name="$sourcedir/sbox.php" /> <remove-file name="$sourcedir/sbox.php" />
<remove-file name="$sourcedir/sboxDB.php" /> <remove-file name="$sourcedir/sboxDB.php" />
<remove-file name="$languagedir/sbox.english.php" />
<remove-file name="$themedir/sbox.template.php" /> <remove-file name="$themedir/sbox.template.php" />
<remove-file name="$themedir/images/sbox_refresh.gif" /> <remove-file name="$themedir/images/sbox_refresh.gif" />
<remove-file name="$boarddir/chat-inbound_GSM.wav" /> <remove-file name="$boarddir/chat-inbound_GSM.wav" />
<remove-file name="$boarddir/sbox.history.html" /> <remove-file name="$boarddir/sbox.history.html" />
<remove-file name="$boarddir/Packages/sbox_v1.11_german.zip" /> <remove-file name="$boarddir/Packages/sbox_v1.12_german.zip" />
<code type="file">sbox_remove.php</code>
</uninstall>
<uninstall for="1.1 RC3">
<readme type="inline">Uninstall will remove all the changes made by the shoutbox. You must do this before upgrading!</readme>
<modification type="file" format="boardmod" reverse="true">sbox_11rc3.mod</modification>
<remove-file name="$sourcedir/sbox.php" />
<remove-file name="$sourcedir/sboxDB.php" />
<remove-file name="$languagedir/sbox.english.php" />
<remove-file name="$themedir/sbox.template.php" />
<remove-file name="$themedir/images/sbox_refresh.gif" />
<remove-file name="$boarddir/chat-inbound_GSM.wav" />
<remove-file name="$boarddir/sbox.history.html" />
<remove-file name="$boarddir/Packages/sbox_v1.12_german.zip" />
<code type="file">sbox_remove.php</code> <code type="file">sbox_remove.php</code>
</uninstall> </uninstall>
<install> <install>

31
sbox.english.php Normal file
View File

@ -0,0 +1,31 @@
<?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';
?>

View File

@ -1,38 +1,39 @@
<?php <?php
/****************************************************************************** /******************************************************************************
* shout.php * * shout.php *
******************************************************************************* *******************************************************************************
* SMF: Simple Machines Forum - SMF Shoutbox MOD * * SMF: Simple Machines Forum - SMF Shoutbox MOD *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) * * Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== * * =========================================================================== *
* Software Version: 1.00 * * Software Version: 1.00 *
* Software originally by: ? * * Software originally by: ? *
* Ported to SMF by: Deep * * Ported to SMF by: Deep *
* Support, News, Updates at: http://www.simplemachines.org * * Support, News, Updates at: http://www.simplemachines.org *
******************************************************************************* *******************************************************************************
* This program is free software; you may redistribute it and/or modify it * * This program is free software; you may redistribute it and/or modify it *
* under the terms of the provided license as published by Lewis Media. * * under the terms of the provided license as published by Lewis Media. *
* * * *
* This program is distributed in the hope that it is and will be useful, * * This program is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of * * but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* * * *
* See the "license.txt" file for details of the Simple Machines license. * * See the "license.txt" file for details of the Simple Machines license. *
* The latest version can always be found at http://www.simplemachines.org. * * The latest version can always be found at http://www.simplemachines.org. *
******************************************************************************/ ******************************************************************************/
if (!defined('SMF')) if (!defined('SMF'))
die('Hacking attempt...'); die('Hacking attempt...');
function sbox_display() function sbox_display()
{ {
global $user_info, $db_prefix, $modSettings, $settings, $sourcedir, $scripturl, $txt, $context; global $user_info, $db_prefix, $modSettings, $settings, $sourcedir, $scripturl, $txt, $context;
if ($modSettings['sbox_Visible'] != '0') if ($modSettings['sbox_Visible'] != '0')
{ {
// Load the template! loadLanguage('sbox');
loadTemplate('sbox'); loadTemplate('sbox');
template_shout_box(); template_shout_box();
} }
} }
?>
?>

View File

@ -8,9 +8,7 @@ require("../SSI.php");
if (!defined('SMF')) if (!defined('SMF'))
die('Hacking attempt...'); die('Hacking attempt...');
// global variables (they are always global since we're here in the main routine) loadLanguage('sbox');
// global $db_connection, $context, $settings, $txt, $user_info, $modSettings, $db_prefix, $boarddir, $boardurl;
$sbox_HistoryFile = $boarddir . '/sbox.history.html'; $sbox_HistoryFile = $boarddir . '/sbox.history.html';
// BEGIN: BORROWED FROM http://de2.php.net/manual/en/function.flock.php // BEGIN: BORROWED FROM http://de2.php.net/manual/en/function.flock.php
@ -175,8 +173,12 @@ if (!empty($_REQUEST['action'])) switch ($_REQUEST['action']) {
case 'clearhist': case 'clearhist':
if ($context['user']['is_admin']) { if ($context['user']['is_admin']) {
if (file_exists($sbox_HistoryFile)) { if (file_exists($sbox_HistoryFile)) {
// TODO: Check for existing lock, wait for lock to be released and delete then. $lockDir = $sbox_HistoryFile . '.lock';
@unlink($sbox_HistoryFile); $start = time();
while ((is_dir($lockDir)) && ((time() - $start) < 5)) {
usleep(100000); // sleep 1/10th of a second (for a PC these are ages!)
}
if (!is_dir($lockDir)) @unlink($sbox_HistoryFile);
} }
} }
break; break;
@ -202,18 +204,16 @@ if ($refreshBlocked) {
echo '</b></div>'; echo '</b></div>';
if ($context['user']['is_admin']) { if ($context['user']['is_admin']) {
echo "\n" . '<div class="Odd">';
if ($modSettings['sbox_DoHistory'] == '1') { if ($modSettings['sbox_DoHistory'] == '1') {
echo "\n" . '<div class="Odd">';
if (file_exists($sbox_HistoryFile)) { if (file_exists($sbox_HistoryFile)) {
echo '[<a href="' . str_replace($boarddir, $boardurl, $sbox_HistoryFile) . '" target="_blank">' . $txt['sbox_History'] . '</a>]'; echo '[<a href="' . str_replace($boarddir, $boardurl, $sbox_HistoryFile) . '" target="_blank">' . $txt['sbox_History'] . '</a>]';
echo ' [<a href="' . $_SERVER['PHP_SELF'] . '?action=clearhist" class="Kill" onClick="return clearHist();">' . $txt['sbox_HistoryClear'] . '</a>]'; echo ' [<a href="' . $_SERVER['PHP_SELF'] . '?action=clearhist" class="Kill" onClick="return clearHist();">' . $txt['sbox_HistoryClear'] . '</a>]';
} else { } else {
echo '[' . $txt['sbox_HistoryNotFound'] . ']'; echo '[' . $txt['sbox_HistoryNotFound'] . ']';
} }
echo '</div>';
} }
// debug output for separator-bar
// echo ' ( CurTime: ' . forum_time(true) . ' / LastTime: ' . $_REQUEST['ts'] . ' )';
echo '</div>';
} }
/* /*

View File

@ -3,7 +3,7 @@ SMF Shoutbox
</id> </id>
<version> <version>
1.11 1.12
</version> </version>
<mod info> <mod info>
@ -31,6 +31,9 @@ Please direct any questions regarding this version to Deep, either by email (die
in the appropriate place at www.simplemachines.org (the preferred option!) in the appropriate place at www.simplemachines.org (the preferred option!)
History: History:
Version 1.12
Version 1.11 Version 1.11
+ added German language-pack + added German language-pack
+ added switch to disable linking to profile pages + added switch to disable linking to profile pages
@ -84,72 +87,6 @@ Deep and Markus Birth
No homepage available at the moment No homepage available at the moment
</homepage> </homepage>
<edit file>
$languagedir/Modifications.english.php
</edit file>
<search for>
?>
</search for>
<add before>
//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';
</add before>
<edit file>
$languagedir/Help.english.php
</edit file>
<search for>
?>
</search for>
<add before>
//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 <i>User online time treshold</i> found in the <i>Basic Features</i>-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.';
</add before>
<edit file> <edit file>
$sourcedir/ModSettings.php $sourcedir/ModSettings.php
</edit file> </edit file>
@ -181,6 +118,8 @@ function ModifyKarmaSettings()
</search for> </search for>
<add before> <add before>
loadLanguage('sbox');
function ModifySboxSettings() function ModifySboxSettings()
{ {
global $txt, $scripturl, $context, $settings, $sc; global $txt, $scripturl, $context, $settings, $sc;
@ -323,3 +262,27 @@ $themedir/BoardIndex.template.php
if (function_exists('sbox')) sbox(); if (function_exists('sbox')) sbox();
</add after> </add after>
<edit file>
$languagedir/Help.english.php
</edit file>
<search for>
?>
</search for>
<add before>
//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 <i>User online time treshold</i> found in the <i>Basic Features</i>-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.';
</add before>