+ added "Please login or register to shout."-message for guests if they are not allowed to shout
x hopefully fixed bug with smileys-insertion into sbox instead of posts if sbox was included into all pages in SMF x hopefully fixed bug with "ANSI_X3.4-1968"-charset, which is just ASCII and seems to be used for UTF-8, also suppressed error messages from htmlentities() + added is_not_banned() before a post is inserted
This commit is contained in:
@ -10,6 +10,7 @@ $txt['sbox_HistoryClear'] = 'Clear history';
|
|||||||
$txt['sbox_HistoryNotFound'] = 'No history found.';
|
$txt['sbox_HistoryNotFound'] = 'No history found.';
|
||||||
$txt['sbox_Guest'] = 'Guest';
|
$txt['sbox_Guest'] = 'Guest';
|
||||||
$txt['sbox_TypeShout'] = '<Type your message and press ENTER>';
|
$txt['sbox_TypeShout'] = '<Type your message and press ENTER>';
|
||||||
|
$txt['sbox_Login'] = 'Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a> to participate.';
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
$txt['sbox_Visible'] = 'Shoutbox is visible';
|
$txt['sbox_Visible'] = 'Shoutbox is visible';
|
||||||
|
@ -10,6 +10,7 @@ $txt['sbox_HistoryClear'] = 'Verlauf löschen';
|
|||||||
$txt['sbox_HistoryNotFound'] = 'Kein Verlauf gefunden.';
|
$txt['sbox_HistoryNotFound'] = 'Kein Verlauf gefunden.';
|
||||||
$txt['sbox_Guest'] = 'Gast';
|
$txt['sbox_Guest'] = 'Gast';
|
||||||
$txt['sbox_TypeShout'] = '<Geben Sie Ihre Nachricht ein und dr<64>cken Sie ENTER>';
|
$txt['sbox_TypeShout'] = '<Geben Sie Ihre Nachricht ein und dr<64>cken Sie ENTER>';
|
||||||
|
$txt['sbox_Login'] = 'Bitte <a href="' . $scripturl . '?action=login">einloggen</a> oder <a href="' . $scripturl . '?action=register">registrieren</a> zum Teilnehmen.';
|
||||||
|
|
||||||
// Einstellungen
|
// Einstellungen
|
||||||
$txt['sbox_Visible'] = 'Shoutbox ist sichtbar';
|
$txt['sbox_Visible'] = 'Shoutbox ist sichtbar';
|
||||||
|
@ -67,6 +67,9 @@ function template_shout_box() {
|
|||||||
echo '
|
echo '
|
||||||
<input type="hidden" name="ts" value="'.forum_time(true).'">
|
<input type="hidden" name="ts" value="'.forum_time(true).'">
|
||||||
<input class="windowbg2" type="text" name="sboxText" size="100" maxlength="320" onFocus="if (this.value==\'' . $txt['sbox_TypeShout'] . '\') this.value = \'\';" onBlur="if (this.value==\'\') this.value=\'' . $txt['sbox_TypeShout'] . '\';" /> <input type="submit" class="input" value=" shout " />';
|
<input class="windowbg2" type="text" name="sboxText" size="100" maxlength="320" onFocus="if (this.value==\'' . $txt['sbox_TypeShout'] . '\') this.value = \'\';" onBlur="if (this.value==\'\') this.value=\'' . $txt['sbox_TypeShout'] . '\';" /> <input type="submit" class="input" value=" shout " />';
|
||||||
|
} else {
|
||||||
|
// guest is not allowed to shout ~~> show message
|
||||||
|
echo $txt['sbox_Login'];
|
||||||
}
|
}
|
||||||
echo '
|
echo '
|
||||||
</form>
|
</form>
|
||||||
@ -204,7 +207,7 @@ function sbox_printSmileys() {
|
|||||||
// If the smileys popup is to be shown... show it!
|
// If the smileys popup is to be shown... show it!
|
||||||
if (!empty($context['smileys']['popup']))
|
if (!empty($context['smileys']['popup']))
|
||||||
echo '
|
echo '
|
||||||
<a href="javascript:moreSmileys();">[', $txt['more_smileys'], ']</a>';
|
<a href="javascript:sbox_moreSmileys();">[', $txt['more_smileys'], ']</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there are additional smileys then ensure we provide the javascript for them.
|
// If there are additional smileys then ensure we provide the javascript for them.
|
||||||
@ -234,7 +237,7 @@ function sbox_printSmileys() {
|
|||||||
echo '];
|
echo '];
|
||||||
var smileyPopupWindow;
|
var smileyPopupWindow;
|
||||||
|
|
||||||
function moreSmileys()
|
function sbox_moreSmileys()
|
||||||
{
|
{
|
||||||
var row, i;
|
var row, i;
|
||||||
|
|
||||||
|
@ -83,12 +83,15 @@ function locked_filewrite($filename, $data, $timeLimit = 300000, $staleAge = 5)
|
|||||||
// END: BORROWED FROM http://de2.php.net/manual/en/function.flock.php
|
// END: BORROWED FROM http://de2.php.net/manual/en/function.flock.php
|
||||||
|
|
||||||
function missinghtmlentities($text) {
|
function missinghtmlentities($text) {
|
||||||
|
global $context;
|
||||||
// entitify missing characters, ignore entities already there (Unicode / UTF8) (hopefully in {-notation)
|
// entitify missing characters, ignore entities already there (Unicode / UTF8) (hopefully in {-notation)
|
||||||
$split = preg_split('/(&#[\d]+;)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
$split = preg_split('/(&#[\d]+;)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||||
$result = '';
|
$result = '';
|
||||||
foreach ($split as $s) {
|
foreach ($split as $s) {
|
||||||
if (substr($s, 0, 2) != '&#' || substr($s, -1, 1) != ';') {
|
if (substr($s, 0, 2) != '&#' || substr($s, -1, 1) != ';') {
|
||||||
$result .= @htmlentities($s, ENT_NOQUOTES, $context['character_set']);
|
// filter out "ANSI_X3.4-1968" charset, which just means plain old ASCII ... replace by UTF-8
|
||||||
|
if (strpos($context['character_set'], 'ANSI_') !== false) $charset = 'UTF-8'; else $charset = $context['character_set'];
|
||||||
|
$result .= @htmlentities($s, ENT_NOQUOTES, $charset);
|
||||||
} else {
|
} else {
|
||||||
$result .= $s;
|
$result .= $s;
|
||||||
}
|
}
|
||||||
@ -165,6 +168,7 @@ if (!empty($_REQUEST['action'])) switch ($_REQUEST['action']) {
|
|||||||
|
|
||||||
case 'write':
|
case 'write':
|
||||||
if (((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == '1')) && !empty($_REQUEST['sboxText'])) {
|
if (((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == '1')) && !empty($_REQUEST['sboxText'])) {
|
||||||
|
is_not_banned(true); // die with message, if user is banned, let him read everything though
|
||||||
$content = $_REQUEST['sboxText'];
|
$content = $_REQUEST['sboxText'];
|
||||||
// get current timestamp
|
// get current timestamp
|
||||||
$date = time();
|
$date = time();
|
||||||
|
Reference in New Issue
Block a user