* raised version number to 1.13
* string cleanup - sorted strings by appearance * added separator lines to settings dialog x added missing 2nd and 3rd parameter do db_query() in sbox_setup.php + DROP TABLE before insert, so that updates to 1.1rc3 will be more easier + $sbox_NickPrefix and $sbox_NickSuffix in sboxDB.php + Guests are now shown as Guest-abcdef with abcdef being their IP in base36, this way you can differentiate guests easily + option to allow Global Moderators to delete shouts + option to disallow BBC for guests only + option to disable the "WhatsNew"-line
This commit is contained in:
parent
5cdb0f1d7b
commit
36251d4fac
@ -4,7 +4,7 @@
|
||||
<name>SMF Shoutbox LanguagePack German</name>
|
||||
<id>Deep:SMF_Shoutbox:LangPack_German</id>
|
||||
<type>modification</type>
|
||||
<version>1.12</version>
|
||||
<version>1.13</version>
|
||||
<install>
|
||||
<require-file name="sbox.german.php" destination="$languagedir" />
|
||||
<readme type="inline">
|
||||
|
@ -2,30 +2,40 @@
|
||||
|
||||
//SMF Shoutbox
|
||||
$txt['sbox_ModTitle'] = 'SMF Shoutbox';
|
||||
$txt['sbox_Visible'] = 'Shoutbox ist sichtbar';
|
||||
$txt['sbox_GuestAllowed'] = 'Gäste dürfen shouten';
|
||||
$txt['sbox_GuestVisible'] = 'Shoutbox ist für Gäste sichtbar';
|
||||
$txt['sbox_MaxLines'] = 'Anzahl der angezeigten Zeilen';
|
||||
$txt['sbox_Height'] = 'Shoutbox-Hö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öße';
|
||||
$txt['sbox_TextColor1'] = '1. Schriftfarbe';
|
||||
$txt['sbox_TextSize2'] = '2. Schriftgröße';
|
||||
$txt['sbox_TextColor2'] = '2. Schriftfarbe';
|
||||
$txt['sbox_RefreshTime'] = 'Aktualisierungsintervall';
|
||||
$txt['sbox_BlockRefresh'] = 'Aktualisierung nach Inaktivitä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ät ausgeschaltet';
|
||||
$txt['sbox_History'] = 'Verlauf';
|
||||
$txt['sbox_HistoryClear'] = 'Verlauf löschen';
|
||||
$txt['sbox_HistoryNotFound'] = 'Kein Verlauf gefunden.';
|
||||
$txt['sbox_Guest'] = 'Gast';
|
||||
|
||||
// Einstellungen
|
||||
$txt['sbox_Visible'] = 'Shoutbox ist sichtbar';
|
||||
$txt['sbox_ModsRule'] = 'Global-Moderatoren können Shouts löschen';
|
||||
$txt['sbox_DoHistory'] = 'Shout-Verlauf anlegen';
|
||||
|
||||
$txt['sbox_GuestVisible'] = 'Shoutbox ist für Gäste sichtbar';
|
||||
$txt['sbox_GuestAllowed'] = 'Gäste dürfen shouten';
|
||||
$txt['sbox_GuestBBC'] = 'BBCode für Gäste erlauben*';
|
||||
|
||||
$txt['sbox_SmiliesVisible'] = 'Smiley-Zeile ist sichtbar';
|
||||
$txt['sbox_UserLinksVisible'] = 'Shouter-Namen mit Profil verlinken';
|
||||
$txt['sbox_AllowBBC'] = 'BBCode erlauben';
|
||||
$txt['sbox_NewShoutsBar'] = 'Zeilenmarkierung anzeigen';
|
||||
$txt['sbox_MaxLines'] = 'Anzahl der angezeigten Zeilen';
|
||||
$txt['sbox_Height'] = 'Shoutbox-Höhe (px)';
|
||||
|
||||
$txt['sbox_RefreshTime'] = 'Aktualisierungsintervall (sec)';
|
||||
$txt['sbox_BlockRefresh'] = 'Aktualisierung nach Inaktivität stoppen (' . $modSettings['lastActive'] . ' min)';
|
||||
$txt['sbox_EnableSounds'] = 'Klänge abspielen';
|
||||
|
||||
$txt['sbox_FontFamily1'] = '1. Schriftart';
|
||||
$txt['sbox_FontFamily2'] = '2. Schriftart';
|
||||
$txt['sbox_TextSize1'] = '1. Schriftgröße';
|
||||
$txt['sbox_TextColor1'] = '1. Schriftfarbe';
|
||||
$txt['sbox_TextSize2'] = '2. Schriftgröße';
|
||||
$txt['sbox_TextColor2'] = '2. Schriftfarbe';
|
||||
$txt['sbox_BackgroundColor'] = 'Hintergrundfarbe';
|
||||
|
||||
?>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<id>
|
||||
SMF Shoutbox , German Language Pack
|
||||
SMF Shoutbox, German Language Pack
|
||||
</id>
|
||||
|
||||
<version>
|
||||
1.12
|
||||
1.13
|
||||
</version>
|
||||
|
||||
<mod info>
|
||||
This is the german language pack for SMF shoutbox 1.10.
|
||||
This is the german language pack for SMF shoutbox.
|
||||
|
||||
Instructions:
|
||||
1. Install SMF shoutbox
|
||||
@ -30,48 +30,6 @@ Deep and Markus Birth
|
||||
http://mods.simplemachines.org/index.php?mod=412
|
||||
</homepage>
|
||||
|
||||
|
||||
|
||||
<edit file>
|
||||
$languagedir/Modifications.german.php
|
||||
</edit file>
|
||||
|
||||
<search for>
|
||||
?>
|
||||
</search for>
|
||||
|
||||
<add before>
|
||||
//SMF Shoutbox
|
||||
$txt['sbox_ModTitle'] = 'SMF Shoutbox';
|
||||
$txt['sbox_Visible'] = 'Shoutbox ist sichtbar';
|
||||
$txt['sbox_GuestAllowed'] = 'Gäste dürfen shouten';
|
||||
$txt['sbox_GuestVisible'] = 'Shoutbox ist für Gäste sichtbar';
|
||||
$txt['sbox_MaxLines'] = 'Anzahl der angezeigten Zeilen';
|
||||
$txt['sbox_Height'] = 'Shoutbox-Hö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öße';
|
||||
$txt['sbox_TextColor1'] = '1. Schriftfarbe';
|
||||
$txt['sbox_TextSize2'] = '2. Schriftgröße';
|
||||
$txt['sbox_TextColor2'] = '2. Schriftfarbe';
|
||||
$txt['sbox_RefreshTime'] = 'Aktualisierungsintervall';
|
||||
$txt['sbox_BlockRefresh'] = 'Aktualisierung nach Inaktivitä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ät ausgeschaltet';
|
||||
$txt['sbox_History'] = 'Verlauf';
|
||||
$txt['sbox_HistoryClear'] = 'Verlauf löschen';
|
||||
$txt['sbox_HistoryNotFound'] = 'Kein Verlauf gefunden.';
|
||||
$txt['sbox_EnableSounds'] = 'Klänge abspielen';
|
||||
|
||||
</add before>
|
||||
|
||||
|
||||
<edit file>
|
||||
$languagedir/Help.german.php
|
||||
</edit file>
|
||||
@ -81,18 +39,22 @@ $languagedir/Help.german.php
|
||||
</search for>
|
||||
|
||||
<add before>
|
||||
|
||||
//SMF Shoutbox
|
||||
$helptxt['sbox_Visible'] = 'Hier können Sie einstellen, ob die Shoutbox sichtbar ist oder nicht. Diese Einstellung gilt für ALLE Benutzer.';
|
||||
$helptxt['sbox_GuestAllowed'] = 'Hier können Sie einstellen, ob Gäste die Shoutbox benutzen dürfen.';
|
||||
$helptxt['sbox_DoHistory'] = 'Legt fest, ob alle Shouts auch in eine Verlaufsdatei geschrieben werden sollen, so dass ein Administrator angebliche Vorfälle nachprüfen kann.';
|
||||
|
||||
$helptxt['sbox_GuestVisible'] = 'Hiermit können Sie festlegen, ob Gäste die Shoutbox überhaupt sehen können oder nicht.';
|
||||
$helptxt['sbox_MaxLines'] = 'Geben Sie hier die Anzahl der Zeilen ein, die in der Shoutbox angezeigt werden sollen.';
|
||||
$helptxt['sbox_Height'] = 'Bestimmen Sie hier die Höhe der Shoutbox (Anzahl der Pixel).';
|
||||
$helptxt['sbox_GuestAllowed'] = 'Hier können Sie einstellen, ob Gäste die Shoutbox benutzen dürfen.';
|
||||
$helptxt['sbox_GuestBBC'] = 'Hier können Sie BBCode für Gast-Shouts ein- oder ausschalten. Beachten Sie bitte, dass dies auch von der Einstellung <i>BBCode erlauben</i> abhängig ist.';
|
||||
|
||||
$helptxt['sbox_SmiliesVisible'] = 'Hier können Sie einstellen, ob die Smilies sichtbar sind oder nicht. Diese Einstellung gilt für ALLE Benutzer.';
|
||||
$helptxt['sbox_UserLinksVisible'] = 'Legt fest, ob die Namen der Shouter mit deren Profilseite verlinkt werden sollen oder nicht.';
|
||||
$helptxt['sbox_AllowBBC'] = 'Legt fest, ob Benutzer BBCode in Shouts benutzen können. Wenn dies deaktiviert ist, wird nur Klartext angezeigt - ohne Smileys oder Formatierungen. Diese Option beeinflusst auch die <i>BBCode für Gäste erlauben</i>-Option.';
|
||||
$helptxt['sbox_NewShoutsBar'] = 'Ist diese Option aktiviert, wird eine Linie zwischen neuen Shouts (seit dem letzten Refresh) und älteren gezeigt.';
|
||||
|
||||
$helptxt['sbox_RefreshTime'] = 'Hier können Sie das Aktualisierungsintervall einstellen, also die Anzahl der Sekunden, die vergehen müssen, bevor sich die Shoutbox automatisch aktualisiert.';
|
||||
$helptxt['sbox_BlockRefresh'] = 'Legt fest, ob die automatische Aktualisierung nach eine Weile Inaktivität automatisch gestoppt werden soll. Benutzer können die Shoutbox weiterhin manuell aktualisieren. Die Zeitspanne wird unter <i>Zeit der Benutzeranzeige</i> in den <i>Standard-Funktionen</i> festgelegt. (Momentan ' . $modSettings['lastActive'] . ' Minuten)';
|
||||
$helptxt['sbox_DoHistory'] = 'Legt fest, ob alle Shouts auch in eine Verlaufsdatei geschrieben werden sollen, so dass ein Administrator angebliche Vorfälle nachprüfen kann.';
|
||||
$helptxt['sbox_AllowBBC'] = 'Legt fest, ob Benutzer BBCode in Shouts benutzen können. Wenn dies deaktiviert ist, wird nur Klartext angezeigt - ohne Smileys oder Formatierungen.';
|
||||
$helptxt['sbox_EnableSounds'] = 'Aktiviert einen Ton, der gespielt wird, wenn der eigene Nickname in einem neuen Shout auftaucht.';
|
||||
|
||||
</add before>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<name>SMF Shoutbox</name>
|
||||
<id>Deep:SMF_Shoutbox</id>
|
||||
<type>modification</type>
|
||||
<version>1.12</version>
|
||||
<version>1.13</version>
|
||||
<install for="1.1 RC2">
|
||||
<require-file name="sbox.php" destination="$sourcedir" />
|
||||
<require-file name="sboxDB.php" destination="$sourcedir" />
|
||||
@ -12,7 +12,7 @@
|
||||
<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" />
|
||||
<require-file name="sbox_v1.13_german.zip" destination="$boarddir/Packages" />
|
||||
<code type="file">sbox_setup.php</code>
|
||||
<readme type="inline">
|
||||
<![CDATA[
|
||||
@ -32,7 +32,7 @@
|
||||
<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" />
|
||||
<require-file name="sbox_v1.13_german.zip" destination="$boarddir/Packages" />
|
||||
<code type="file">sbox_setup.php</code>
|
||||
<readme type="inline">
|
||||
<![CDATA[
|
||||
@ -55,7 +55,7 @@
|
||||
<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" />
|
||||
<remove-file name="$boarddir/Packages/sbox_v1.13_german.zip" />
|
||||
<code type="file">sbox_remove.php</code>
|
||||
</uninstall>
|
||||
<uninstall for="1.1 RC3">
|
||||
@ -68,7 +68,7 @@
|
||||
<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" />
|
||||
<remove-file name="$boarddir/Packages/sbox_v1.13_german.zip" />
|
||||
<code type="file">sbox_remove.php</code>
|
||||
</uninstall>
|
||||
<install>
|
||||
|
@ -2,30 +2,40 @@
|
||||
|
||||
//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_KillShout'] = 'Do you want to kill this shout?';
|
||||
$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_Guest'] = 'Guest';
|
||||
|
||||
// Settings
|
||||
$txt['sbox_Visible'] = 'Shoutbox is visible';
|
||||
$txt['sbox_ModsRule'] = 'Global Moderators can delete shouts';
|
||||
$txt['sbox_DoHistory'] = 'Create history of shouts';
|
||||
|
||||
$txt['sbox_GuestVisible'] = 'Make Shoutbox visible to Guests';
|
||||
$txt['sbox_GuestAllowed'] = 'Guests are allowed to shout';
|
||||
$txt['sbox_GuestBBC'] = 'Allow BBCode for Guest-shouts*';
|
||||
|
||||
$txt['sbox_SmiliesVisible'] = 'Smiley row is visible';
|
||||
$txt['sbox_UserLinksVisible'] = 'Show profile links';
|
||||
$txt['sbox_AllowBBC'] = 'Allow BBCode';
|
||||
$txt['sbox_NewShoutsBar'] = 'Show line marker';
|
||||
$txt['sbox_MaxLines'] = 'Maximum number of displayed shouts';
|
||||
$txt['sbox_Height'] = 'Shoutbox height (px)';
|
||||
|
||||
$txt['sbox_RefreshTime'] = 'Refresh time (secs)';
|
||||
$txt['sbox_BlockRefresh'] = 'Block Refresh after inactivity (' . $modSettings['lastActive'] . ' mins)';
|
||||
$txt['sbox_EnableSounds'] = 'Enable sounds';
|
||||
|
||||
$txt['sbox_FontFamily1'] = '1. Font family';
|
||||
$txt['sbox_FontFamily2'] = '2. Font family';
|
||||
$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_BackgroundColor'] = 'Background color';
|
||||
|
||||
?>
|
||||
|
@ -84,6 +84,7 @@ function template_shout_box() {
|
||||
</div>';
|
||||
}
|
||||
|
||||
// BEGIN: Borrowed from theme_postbox($msg) in Subs-Post.php (1.1rc3)
|
||||
function sbox_loadSmileys() {
|
||||
global $context, $settings, $user_info, $txt, $modSettings, $db_prefix;
|
||||
|
||||
@ -160,7 +161,9 @@ function sbox_loadSmileys() {
|
||||
}
|
||||
$settings['smileys_url'] = $modSettings['smileys_url'] . '/' . $user_info['smiley_set'];
|
||||
}
|
||||
// END: Borrowed from theme_postbox($msg) in Subs-Post.php
|
||||
|
||||
// BEGIN: Borrowed from template_postbox(&$message) in Post.template.php (1.1rc3)
|
||||
function sbox_printSmileys() {
|
||||
global $context, $txt, $settings;
|
||||
|
||||
@ -242,5 +245,6 @@ function sbox_printSmileys() {
|
||||
// ]]></script>';
|
||||
}
|
||||
}
|
||||
// END: Borrowed from template_postbox(&$message) in Post.template.php
|
||||
|
||||
?>
|
47
sboxDB.php
47
sboxDB.php
@ -10,6 +10,8 @@ if (!defined('SMF'))
|
||||
|
||||
loadLanguage('sbox');
|
||||
$sbox_HistoryFile = $boarddir . '/sbox.history.html';
|
||||
$sbox_NickPrefix = '<';
|
||||
$sbox_NickSuffix = '>';
|
||||
|
||||
// BEGIN: BORROWED FROM http://de2.php.net/manual/en/function.flock.php
|
||||
/*
|
||||
@ -122,7 +124,7 @@ echo '
|
||||
text-decoration: none;
|
||||
color: blue;
|
||||
}
|
||||
A.Kill {
|
||||
.Kill, A.Kill {
|
||||
color: #ff0000;
|
||||
}
|
||||
</style>';
|
||||
@ -136,8 +138,12 @@ if (!empty($_REQUEST['action'])) switch ($_REQUEST['action']) {
|
||||
// get current timestamp
|
||||
$date = time();
|
||||
|
||||
$posterip = $user_info['ip'];
|
||||
$pip = explode('.', $posterip);
|
||||
$piph = sprintf("%02s%02s%02s%02s", dechex($pip[0]), dechex($pip[1]), dechex($pip[2]), dechex($pip[3]));
|
||||
|
||||
// handle special characters
|
||||
$content = addslashes($content);
|
||||
$content = addslashes($piph . $content);
|
||||
|
||||
// insert shout message into database
|
||||
$sql = "INSERT INTO " . $db_prefix . "sbox_content (ID_MEMBER, content, time) VALUES ('" . $context['user']['id'] . "', '" . $content . "', '$date')";
|
||||
@ -154,12 +160,21 @@ if (!empty($_REQUEST['action'])) switch ($_REQUEST['action']) {
|
||||
$ds = date('Y-m-d', $date) . ' | ' . date('H:i.s', $date);
|
||||
|
||||
$content = stripslashes($content); // shouting content
|
||||
$content = substr($content, 8);
|
||||
$content = htmlentities($content);
|
||||
if ($modSettings['sbox_AllowBBC'] == '1') {
|
||||
if ($modSettings['sbox_AllowBBC'] == '1' && ($context['user']['id'] > 0 || $modSettings['sbox_GuestBBC'] == '1')) {
|
||||
$content = parse_bbc($content);
|
||||
}
|
||||
|
||||
$output = '[ ' . $ds . ' ] <b><<a href="' . $scripturl . '?action=profile;u=' . $context['user']['id'] . '" target="_blank" class="' . $divclass . '">' . ((!empty($context['user']['name']))?$context['user']['name']:$context['user']['username']) . '</a>></b> ' . $content . '</div><br />' . "\n";
|
||||
$output = '[ ' . $ds . ' ] <b>' . $sbox_NickPrefix;
|
||||
if ($context['user']['id'] > 0) {
|
||||
$output .= '<a href="' . $scripturl . '?action=profile;u=' . $context['user']['id'] . '" target="_blank" class="' . $divclass . '">';
|
||||
$output .= ((!empty($context['user']['name']))?$context['user']['name']:$context['user']['username']);
|
||||
$output .= '</a>';
|
||||
} else {
|
||||
$output .= 'Guest-' . base_convert($piph, 16, 36);
|
||||
}
|
||||
$output .= $sbox_NickSuffix . '</b> ' . $content . '</div><br />' . "\n";
|
||||
|
||||
if (!file_exists($sbox_HistoryFile)) {
|
||||
// TODO: Prepare file ... HTML-header, stylesheet, etc.
|
||||
@ -184,7 +199,7 @@ if (!empty($_REQUEST['action'])) switch ($_REQUEST['action']) {
|
||||
break;
|
||||
|
||||
case 'kill':
|
||||
if ($context['user']['is_admin'] && !empty($_REQUEST['kill'])) {
|
||||
if (!empty($_REQUEST['kill']) && ($context['user']['is_admin'] || ($modSettings['sbox_ModsRule'] && allowedTo('manage_boards')))) {
|
||||
$sql = 'DELETE FROM ' . $db_prefix . 'sbox_content WHERE id=' . intval($_REQUEST['kill']);
|
||||
db_query($sql, __FILE__, __LINE__);
|
||||
}
|
||||
@ -242,13 +257,15 @@ if(mysql_num_rows($result)) {
|
||||
$name = $row['ID_MEMBER']; // user name
|
||||
$date = forum_time(true, $row['time']); // shouting date and time
|
||||
$content = stripslashes($row['content']); // shouting content
|
||||
$piph = substr($content, 0, 8);
|
||||
$content = substr($content, 8);
|
||||
$content = htmlentities($content);
|
||||
if ($modSettings['sbox_AllowBBC'] == '1') {
|
||||
if ($modSettings['sbox_AllowBBC'] == '1' && ($name > 0 || $modSettings['sbox_GuestBBC'] == '1')) {
|
||||
$content = parse_bbc($content);
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['ts']) && !$div && $date<$_REQUEST['ts']) {
|
||||
if ($count > 0) {
|
||||
if ($count > 0 && $modSettings['sbox_NewShoutsBar'] == '1') {
|
||||
echo '<hr>' . "\n";
|
||||
}
|
||||
$div = true;
|
||||
@ -286,7 +303,7 @@ if(mysql_num_rows($result)) {
|
||||
echo "\n" . '<div class="' . $divclass . '" style="color: #' . $colh . '">'; */
|
||||
echo "\n" . '<div class="' . $divclass . '">';
|
||||
|
||||
if ($context['user']['is_admin']) {
|
||||
if ($context['user']['is_admin'] || ($modSettings['sbox_ModsRule'] && allowedTo('manage_boards'))) {
|
||||
echo '[<a title="' . $txt['sbox_KillShout'] . '" class="Kill" onClick="return kill();" href="' . $_SERVER['PHP_SELF'] . '?action=kill&kill=' . $row['id'] . '">X</a>]';
|
||||
}
|
||||
|
||||
@ -304,11 +321,15 @@ if(mysql_num_rows($result)) {
|
||||
$content = str_replace($user_info['username'], '<b><u>' . $user_info['username'] . '</u></b>', $content);
|
||||
}
|
||||
|
||||
echo '[ ' . $ds . ' ] <b><';
|
||||
if ($modSettings['sbox_UserLinksVisible'] == '1') echo '<a href="' . $scripturl . '?action=profile;u=' . $name . '" target="_top" class="' . $divclass . '">';
|
||||
echo ((!empty($row['realName']))?$row['realName']:$row['memberName']);
|
||||
if ($modSettings['sbox_UserLinksVisible'] == '1') echo '</a>';
|
||||
echo '></b> ' . $content . '</div>';
|
||||
echo '[ ' . $ds . ' ] <b>' . $sbox_NickPrefix;
|
||||
if ($name > 0) {
|
||||
if ($modSettings['sbox_UserLinksVisible'] == '1') echo '<a href="' . $scripturl . '?action=profile;u=' . $name . '" target="_top" class="' . $divclass . '">';
|
||||
echo ((!empty($row['realName']))?$row['realName']:$row['memberName']);
|
||||
if ($modSettings['sbox_UserLinksVisible'] == '1') echo '</a>';
|
||||
} else {
|
||||
echo $txt['sbox_Guest'] . '-' . base_convert($piph, 16, 36);
|
||||
}
|
||||
echo $sbox_NickSuffix . '</b> ' . $content . '</div>';
|
||||
}
|
||||
if (($modSettings['sbox_EnableSounds']) && ($alert === true) && ($div === true)) {
|
||||
echo '<embed src="' . $boardurl . '/chat-inbound_GSM.wav" hidden="true" autostart="true" loop="false"></embed>' . "\n";
|
||||
|
@ -3,7 +3,7 @@ SMF Shoutbox
|
||||
</id>
|
||||
|
||||
<version>
|
||||
1.12
|
||||
1.13
|
||||
</version>
|
||||
|
||||
<mod info>
|
||||
@ -32,7 +32,12 @@ 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.<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
|
||||
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
|
||||
@ -84,7 +89,7 @@ Deep and Markus Birth
|
||||
</author>
|
||||
|
||||
<homepage>
|
||||
No homepage available at the moment
|
||||
http://mods.simplemachines.org/index.php?mod=412
|
||||
</homepage>
|
||||
|
||||
<edit file>
|
||||
@ -126,17 +131,30 @@ function ModifySboxSettings()
|
||||
|
||||
$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_DoHistory'),
|
||||
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',
|
||||
@ -204,7 +222,6 @@ function ModifySboxSettings()
|
||||
),
|
||||
array('text', 'sbox_TextColor2'),
|
||||
array('text', 'sbox_BackgroundColor'),
|
||||
array('check', 'sbox_EnableSounds'),
|
||||
);
|
||||
|
||||
// Saving?
|
||||
@ -274,15 +291,19 @@ $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_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_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_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 <i>Allow BBCode</i> 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 <i>Allow BBCode for Guest-shouts</i>-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 <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>
|
||||
|
@ -20,16 +20,24 @@ $overwrite_old_settings = false;
|
||||
// List settings here in the format: setting_key => default_value. Escape any "s. (" => \")
|
||||
$mod_settings = array(
|
||||
'sbox_Visible' => '1',
|
||||
'sbox_GuestAllowed' => '0',
|
||||
'sbox_ModsRule' => '0',
|
||||
'sbox_DoHistory' => '1',
|
||||
|
||||
'sbox_GuestVisible' => '0',
|
||||
'sbox_GuestAllowed' => '0',
|
||||
'sbox_GuestBBC' => '0',
|
||||
|
||||
'sbox_SmiliesVisible' => '1',
|
||||
'sbox_UserLinksVisible' => '1',
|
||||
'sbox_AllowBBC' => '1',
|
||||
'sbox_DoHistory' => '1',
|
||||
'sbox_NewShoutsBar' => '1',
|
||||
'sbox_MaxLines' => '50',
|
||||
'sbox_Height' => '180',
|
||||
|
||||
'sbox_RefreshTime' => '20',
|
||||
'sbox_BlockRefresh' => '1',
|
||||
'sbox_EnableSounds' => '0',
|
||||
|
||||
'sbox_FontFamily1' => 'Verdana, sans-serif',
|
||||
'sbox_FontFamily2' => 'Verdana, sans-serif',
|
||||
'sbox_TextSize1' => 'xx-small',
|
||||
@ -37,7 +45,6 @@ $mod_settings = array(
|
||||
'sbox_TextSize2' => 'xx-small',
|
||||
'sbox_TextColor2' => '#476c8e',
|
||||
'sbox_BackgroundColor' => '#e5e5e8',
|
||||
'sbox_EnableSounds' => '0',
|
||||
);
|
||||
|
||||
/******************************************************************************/
|
||||
@ -60,19 +67,22 @@ if ($string != '')
|
||||
$result = db_query("
|
||||
" . ($overwrite_old_settings ? 'REPLACE' : 'INSERT IGNORE') . " INTO {$db_prefix}settings
|
||||
(variable, value)
|
||||
VALUES" . substr($string, 0, -1));
|
||||
VALUES" . substr($string, 0, -1), __FILE__, __LINE__);
|
||||
|
||||
// Uh-oh spaghetti-oh!
|
||||
if ($result === false)
|
||||
echo '<b>Error:</b> Settings insertion failed!<br />';
|
||||
|
||||
// drop table if it exists. Should make SMF-update 1.1rc2 -> 1.1rc3 easier.
|
||||
$result = mysql_query("DROP TABLE `{$db_prefix}sbox_content`");
|
||||
|
||||
$result = db_query("
|
||||
CREATE TABLE `{$db_prefix}sbox_content` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`time` int(10) unsigned NOT NULL,
|
||||
`ID_MEMBER` mediumint(8) unsigned NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
PRIMARY KEY (`id`))");
|
||||
PRIMARY KEY (`id`))", __FILE__, __LINE__);
|
||||
|
||||
// Uh-oh spaghetti-oh!
|
||||
if ($result === false)
|
||||
|
Reference in New Issue
Block a user