Archived
1
0

x check for empty $_REQUEST['action'] before switch()

+ added option to disable sound notification
This commit is contained in:
mbirth
2006-08-08 12:05:15 +00:00
parent 670e553ec6
commit 09a6c3474e
3 changed files with 8 additions and 3 deletions
+3 -2
View File
@@ -125,7 +125,7 @@ echo '<html xmlns="http://www.w3.org/1999/xhtml"' . ($context['right_to_left']?'
</style>';
switch ($_REQUEST['action']) {
if (!empty($_REQUEST['action'])) switch ($_REQUEST['action']) {
case 'write':
if (((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == '1')) && !empty($_REQUEST['sboxText'])) {
@@ -182,6 +182,7 @@ switch ($_REQUEST['action']) {
db_query($sql, __FILE__, __LINE__);
}
break;
}
// close header and open body
@@ -296,7 +297,7 @@ if(mysql_num_rows($result)) {
echo '[&nbsp;' . $ds . '&nbsp;]&nbsp;<b>&lt;<a href="' . $scripturl . '?action=profile;u=' . $name . '" target="_top" class="' . $divclass . '">' . ((!empty($row['realName']))?$row['realName']:$row['memberName']) . '</a>&gt;</b>&nbsp;' . $content . '</div>';
}
if ($alert === true && $div === true) {
if (($modSettings['sbox_EnableSounds']) && ($alert === true) && ($div === true)) {
echo '<embed src="' . $boardurl . '/chat-inbound_GSM.wav" hidden="true" autostart="true" loop="false"></embed>' . "\n";
}
}
+4 -1
View File
@@ -111,6 +111,7 @@ $txt['sbox_Refresh'] = 'Refresh';
$txt['sbox_History'] = 'History';
$txt['sbox_HistoryClear'] = 'Clear history';
$txt['sbox_HistoryNotFound'] = 'No history found.';
$txt['sbox_EnableSounds'] = 'Enable sounds';
</add before>
@@ -134,6 +135,7 @@ $helptxt['sbox_SmiliesVisible'] = 'Here you can decide whether smileys are visib
$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.';
</add before>
@@ -249,7 +251,8 @@ function ModifySboxSettings()
),
),
array('text', 'sbox_TextColor2'),
array('text', 'sbox_BackgroundColor')
array('text', 'sbox_BackgroundColor'),
array('check', 'sbox_EnableSounds'),
);
// Saving?
+1
View File
@@ -35,6 +35,7 @@ $mod_settings = array(
'sbox_TextSize2' => 'xx-small',
'sbox_TextColor2' => '#476c8e',
'sbox_BackgroundColor' => '#e5e5e8',
'sbox_EnableSounds' => '0',
);
/******************************************************************************/